package com.xxxx.spark.operator

import com.xxxx.spark.WorldCount
import org.apache.spark.{SparkConf, SparkContext}

/**
 * 转换算子是返回一个新的RDD
 */
object TransformationsFun {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
    conf.setMaster("local").setAppName("transformation_operator")
    val sc = new SparkContext(conf)

    //数据(RDD)的产生，RDD之间的相互转换
    val file = WorldCount.getClass.getClassLoader.getResource("src/main/resources/data/hello.txt").getFile

    val lineRDD = sc.textFile(file)
    println(sc.defaultMinPartitions)
    println(sc.defaultParallelism)


    sc.stop()

  }
}
